<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta name="viewport"
	      content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>节流函数throttle</title>
	<script src="index.js"></script>
</head>
<body>
<div  style="height: 9000px;"></div>
</body>
</html>
<script>
	let callback=function (e) {
		console.log(e)
	}
	document.addEventListener('scroll',throttle(callback,500))
</script>
